package top.huntwolf.admin.utils;

import java.util.UUID;

public class UUIDUtil {

    public static String getCartID(int len){
        if (len <= 0){
            return null;
        }

        String uuid = getUUID();
        StringBuilder stringBuffer = new StringBuilder();
        for (int i = 0; i < len; i++) {
            stringBuffer.append(uuid.charAt(i));
        }

        return stringBuffer.toString();

    }

    public static String getUUID(){
        return UUID.randomUUID().toString().replace("-","");
    }


}
